package com.tulingxueyuan.stock.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author :tangweiliang
 * @date : 2023/1/11 11:38
 * 未来的你会感谢现在努力的自己
 */
@RestController
@RequestMapping("/stock")
public class StockController {

    @Value("${server.port}")
    String port;

    @RequestMapping("/reduct")
    public String reduct(){
        System.out.println("扣减库存!");
        return "扣减库存:"+port;
    }

    @RequestMapping("/reduct2")
    public String reduct2(){
        int i = 1/0;
        System.out.println("扣减库存!");
        return "扣减库存:"+port;
    }
}
